<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Orders extends Model
{
    protected $table='ea_order';
    public static function  createOrder($where){
      return  self::create($where);
    }
    //查找订单详情
    public static function detailsOrder($order_id){
      return self::where('id','=',$order_id)->find();
    }
    //修改待支付订单状态
    public static function updateOrder($order_id,$where)
    {
      return self::where('id','=',$order_id)->updateData($where);
    }
    //修改订单状态
    public static function updateOrderStatus($order_id,$where)
    {
      return self::where('id','=',$order_id)->updateData($where);
    }
    //修改订单状态为已核销
    public function changeChargeOff($order_no)
    {
        return self::where('order_no',$order_no)->update(['status'=>9]);
    }
}
